﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace LivestreamE_Commerce.Migrations
{
    public partial class LivestreamE_Commerce20211230_2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BrandAndProductTypeRelationshipModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    BrandId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductTypeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BrandAndProductTypeRelationshipModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "CommodityBrandModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Brand = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BrandName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BrandWebsit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BrandLogo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BrandIsALargerVersion = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BrandDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: false),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommodityBrandModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "CommodityInformationModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CommodityCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommoditySubtitle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BrandId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityTypeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PrimaryCommodityClassificationId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SecondaryCommodityClassificationId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TertiaryCommodityClassificationId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Unit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityKeywords = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityLabel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GeneralSpecificationParameters = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificSpecificationParameters = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackingList = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AfterSalesService = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: false),
                    AuditState = table.Column<int>(type: "int", nullable: false),
                    TheFirstPicture = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityBanner = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityImages = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StartTimeOfPromotion = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PromotionEndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ActivityPurchaseLimit = table.Column<int>(type: "int", nullable: false),
                    Postscript = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CommodityInformationModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "FeatureSelectionModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    AttributeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ItemValue = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FeatureSelectionModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "GoodsCategoryModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    FatherId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortingCodeNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CategoryName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CategoryDescribe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CategoryPictureCover = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClassificationOfIcon = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: false),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GoodsCategoryModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "GoodsInformationModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    SKUName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SkuCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityPrices = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    PromotionPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Postscript = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificationSubscriptCombination = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificSpecificationParameters = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GoodsInformationModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "GoodsInventoryModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    SKUId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Stock = table.Column<int>(type: "int", nullable: false),
                    AlarmStock = table.Column<int>(type: "int", nullable: false),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GoodsInventoryModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ProductPropertySelectionAssociationModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CommoditySkuID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommoditySkuCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PropertyId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FeatureSelection = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProductPropertySelectionAssociationModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ProductSpecificationSelectionAssociationModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CommoditySkuID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommoditySkuCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificationParameterId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificationSelectionId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProductSpecificationSelectionAssociationModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SpecificationGroupingTableModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Coding = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificationGroupName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    commodityTypeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: false),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SpecificationGroupingTableModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SpecificationParameterSelectionModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    SpecificationId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificationParameterValue = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SkuSpecificationsAndPictures = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SpecificationParameterSelectionModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SpecificationsParameterInformationModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    SpecificationsSetId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CommodityTypeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SpecificationsName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: false),
                    DisplayUsage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhetherTheGeneral = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsItSearchable = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WhetherNumericType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ParametersOfTheUnit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SectionGap = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SpecificationsParameterInformationModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TheAttributeNameModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CommodityTypeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PropertyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: false),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TheAttributeNameModel", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TypeOfMerchandiseModel",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    TypeEncoding = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeTheAlias = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VirtualGoodsOrNot = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sort = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TypeOfMerchandiseModel", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BrandAndProductTypeRelationshipModel");

            migrationBuilder.DropTable(
                name: "CommodityBrandModel");

            migrationBuilder.DropTable(
                name: "CommodityInformationModel");

            migrationBuilder.DropTable(
                name: "FeatureSelectionModel");

            migrationBuilder.DropTable(
                name: "GoodsCategoryModel");

            migrationBuilder.DropTable(
                name: "GoodsInformationModel");

            migrationBuilder.DropTable(
                name: "GoodsInventoryModel");

            migrationBuilder.DropTable(
                name: "ProductPropertySelectionAssociationModel");

            migrationBuilder.DropTable(
                name: "ProductSpecificationSelectionAssociationModel");

            migrationBuilder.DropTable(
                name: "SpecificationGroupingTableModel");

            migrationBuilder.DropTable(
                name: "SpecificationParameterSelectionModel");

            migrationBuilder.DropTable(
                name: "SpecificationsParameterInformationModel");

            migrationBuilder.DropTable(
                name: "TheAttributeNameModel");

            migrationBuilder.DropTable(
                name: "TypeOfMerchandiseModel");
        }
    }
}
